<template>
    <h1>学习Form表单</h1>
    <div style="width: 600px; padding: 10px 20px;">
    <el-form :model="form" label-width="60px" >
         <el-form-item label="用户名">
            <el-input v-model="form.name" />
       </el-form-item>
         <el-form-item label="地址">
      <el-select v-model="form.region" placeholder="请选择你所在的区域">
        <el-option label="姑苏区" value="gusu" />
        <el-option label="相城区" value="xiangcheng" />
      </el-select>
    </el-form-item>
      <el-form-item label="时间">
      <el-col :span="11">
        <el-date-picker
          v-model="form.date1"
          type="date"
          placeholder="Pick a date"
          style="width: 100%"
        />
      </el-col>
      <el-col :span="2" class="text-center">
        <span class="text-gray-500">-</span>
      </el-col>
      <el-col :span="11">
        <el-time-picker
          v-model="form.date2"
          placeholder="Pick a time"
          style="width: 100%"
        />
      </el-col>
    </el-form-item>

     <el-form-item label="状态">
      <el-switch v-model="form.delivery" />
    </el-form-item>
    <el-form-item label="类型">
      <el-checkbox-group v-model="form.type">
        <el-checkbox value="Online activities" name="type">
          Online activities
        </el-checkbox>
        <el-checkbox value="Promotion activities" name="type">
          Promotion activities
        </el-checkbox>
        <el-checkbox value="Offline activities" name="type">
          Offline activities
        </el-checkbox>
        <el-checkbox value="Simple brand exposure" name="type">
          Simple brand exposure
        </el-checkbox>
      </el-checkbox-group>
    </el-form-item>
    <el-form-item label="性别">
      <el-radio-group v-model="form.gender">
        <el-radio value="男">男</el-radio>
        <el-radio value="女">女</el-radio>
      </el-radio-group>
    </el-form-item>
    <el-form-item label="描述">
      <el-input v-model="form.desc" type="textarea" />
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="onSubmit">创建</el-button>
      <el-button>取消</el-button>
    </el-form-item>
    </el-form>
    </div>
</template>

<script setup>
import {ref,reactive} from 'vue'
const form = reactive({
    name:'',
    region:'',
    date1:'',
    date2:'',
    delivery:false,
    type:['Online activities'],
    gender:'男',
    desc:''
})
const  onSubmit = () => {
    console.log('submit!');
}
</script >
<style scoped>
</style>